package com.designpattern.singleton.lazysingleton;

public class LazySingletonTest {
    public static void main(String[] args) throws InterruptedException {

//        LazySingleton instance = LazySingleton.getInstance();
//        LazySingleton instance2 = LazySingleton.getInstance();
//        System.out.println(instance2==instance);

        new Thread(() -> {

            LazySingleton instance = LazySingleton.getInstance();
            System.out.println(instance);

        }).start();
        new Thread(() -> {

            LazySingleton instance = LazySingleton.getInstance();
            System.out.println(instance);

        }).start();
    }

}
